package com.cet.lxf.collection.test03;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-08-04 11:15
 **/
public class Main {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        map.put("apple", 123);
        map.put("pear", 456);
        map.put("banana", 789);
        for (String key : map.keySet()) {
            System.out.println("key:" + key + ", value:" + map.get(key));
        }

        System.out.println("==========================");

        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            System.out.println("key:" + entry.getKey() + ",value:" + entry.getValue());
        }

    }
}
